# def hanoi(n, a, b, c):
#     if n > 0:
#     # 第一步：将n-1个盘子从a经过c移动到b
#             hanoi(n-1,a,c,b)
#             print("从 %s 到 %s" % (a, c))
#     # 第二步： 将n-1个盘子从b经过a移动到c
#             hanoi(n-1,b,a,c)
#
# hanoi(3,"a","b","c")
#


def hanoi(n, a, b, c):
    if n>0:
        hanoi(n-1,a,c,b)
        print("moving from %s to %s" % (a,c))
        hanoi(n-1,b,a,c)

hanoi(3,"a","b","c")